Skip to content

fix: bump goja to pick up its own upstream fix for engine#418 - #446

Merged
tannevaled merged 2 commits into
mainfrom
fix-engine418-goja-dependency-bump
Nov 21, 2026
Merged

tannevaled merged 2 commits into
mainfrom
fix-engine418-goja-dependency-bump

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Summary

  • Fixes i18n: every localized string renders as "key 'X (en)' returned an object instead of string" on github.com's own Support app #418: every localized string on github.com's own Support app was
    rendering as i18next's literal key 'X (en)' returned an object instead of string. fallback. Round 48 found and reproduced the real cause in
    isolation: a goja compiler bug (a function with one declared parameter
    reading arguments[N], N>=1, with a nested non-arrow closure
    capturing another local variable, corrupts that variable's storage).
  • A priorart search against dop251/goja's own tracker found this is
    already fixed upstream: dop251/goja#862, merged 2026-11-10, a month
    after this repo's previously pinned commit. Bumping go.mod's goja
    dependency is the entire fix — no engine-level code change needed.
  • Verified directly (not assumed from the upstream PR description): the
    exact real resolve() function body, run standalone against the bumped
    goja, now produces correct results on every case that was wrong before.
    Re-rendered the real support.github.com page end to end — every
    string renders correctly, zero instances of the fallback text,
    confirmed visually against the rendered output.
  • bench/'s own separate nested module also needed its own go mod tidy
    pass (its own commit) since the root module's tidy doesn't reach it.

See FIDELITY.md's own round 48/49 entries for the full investigation
trail.

Test plan

  • go build ./..., go vet ./..., gofmt -l . clean
  • go test ./... clean
  • govulncheck ./... clean (0 vulnerabilities affecting this code)
  • go test ./... -race: two pre-existing, unrelated flakes in
    js/worker_test.go (a synchronization gap between the test's own
    goroutines) — confirmed to reproduce identically on unmodified
    main before this change, out of this PR's scope
  • Re-rendered https://support.github.com/request/landing end to
    end and visually confirmed every string is correct

🤖 Generated with Claude Code

tannevaled and others added 2 commits November 21, 2026 21:05
Round 48's investigation found and reproduced the goja compiler bug
behind engine#418 (every localized string on github.com's own Support
app rendering as i18next's literal "returned an object instead of
string" fallback) in isolation: a function with one declared parameter
that reads arguments[N] for N>=1, with a nested non-arrow closure
capturing another local variable, corrupts that variable's storage.

A priorart search against dop251/goja's own tracker (before concluding
no engine-level fix was possible, per this fleet's own bibliography-first
rule) found this is already fixed upstream: dop251/goja#862, "Fixed extra
arguments overwriting variables in the stash when arguments are copied to
it", merged 2026-11-10 into 844f1a0e4767 - a month after this repo's
pinned goja commit (2026-09-26). Verified directly: the exact real
resolve() function body, run standalone against the bumped goja, now
produces the correct value on every one of the cases that were wrong
before (both the real i18next shape and a from-scratch generic repro, at
1/2/3 levels of closure nesting). Re-rendered the real
support.github.com page end to end: every string now renders correctly
("Help", "Sign in with GitHub", "New to GitHub? Create an account", ...),
zero instances of the fallback text, confirmed visually against the
rendered PNG.

go test ./... and govulncheck ./... clean. go test ./... -race shows two
pre-existing, unrelated flakes in js/worker_test.go (a shared-variable
race between the test's own goroutines, nothing to do with goja or this
fix) - confirmed to reproduce identically on unmodified main before this
change, out of this PR's scope.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
bench is a separate nested module (its own go.mod) that also carries
goja as an indirect dependency; go mod tidy at the repo root does not
enter it, so it needed its own tidy pass to match the previous commit's
root-level bump.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@tannevaled
tannevaled force-pushed the fix-engine418-goja-dependency-bump branch from eb72ba9 to 7e12e32 Compare November 21, 2026 20:05
@tannevaled
tannevaled merged commit e618db1 into main Nov 21, 2026
13 checks passed
@tannevaled
tannevaled deleted the fix-engine418-goja-dependency-bump branch November 21, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

i18n: every localized string renders as "key 'X (en)' returned an object instead of string" on github.com's own Support app

1 participant